package com.fenghongzhang.day014;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;


/**
 * A simple {@link Fragment} subclass.
 */
public class BlankFragment2 extends Fragment {

    //Text t

    public BlankFragment2() {
        // Required empty public constructor
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //
        MyBraodcast myBraodcast = new MyBraodcast();
        IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction("com.com");
        getActivity().registerReceiver(myBraodcast,intentFilter);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment

        return inflater.inflate(R.layout.fragment_blank2, container, false);
    }

    class MyBraodcast extends BroadcastReceiver{
        @Override
        public void onReceive(Context context, Intent intent) {
            ///
//            t.setText
        }
    }
}
